package com.sjh.test.java8.time;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public class LocalDateTimeTest1 {

    public static void main(String args[]) {
        LocalDateTimeTest1 tester = new LocalDateTimeTest1();
        tester.run();
    }

    public void run() {
        LocalDateTime currentTime = LocalDateTime.now();
        System.out.println("当前日期时间: " + currentTime);

        LocalDate date1 = currentTime.toLocalDate();
        System.out.println("当前日期: " + date1);

        LocalTime time1 = currentTime.toLocalTime();
        System.out.println("当前时间: " + time1);
    }
}
